package com.lankystar.sos.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * 响应单
 * @author SYX
 *
 */
@Entity
@Table(name="sos_responseOrder")
public class ResponseOrder implements Serializable{

	private static final long serialVersionUID = 1L;
	/**
	 * id、 响应状态（无法前往、前往施救）、推送次数记录、创建时间、最后修改时间、施救者、求救单
	 */
	private int responseId;
	private ResponseStatus respStatus;
	private int pushCount;
	private Date createTime;
	private Date lastUpdateTime;
	private User user;
	private SosOrder sosOrder;//求救单-->响应单   一对多
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	public int getResponseId() {
		return responseId;
	}
	public void setResponseId(int responseId) {
		this.responseId = responseId;
	}
	public int getPushCount() {
		return pushCount;
	}
	public void setPushCount(int pushCount) {
		this.pushCount = pushCount;
	}
	@ManyToOne
	@JoinColumn(name="respStatus_Id")
	public ResponseStatus getRespStatus() {
		return respStatus;
	}
	public void setRespStatus(ResponseStatus respStatus) {
		this.respStatus = respStatus;
	}
	@Temporal(TemporalType.TIMESTAMP)
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	public Date getLastUpdateTime() {
		return lastUpdateTime;
	}
	public void setLastUpdateTime(Date lastUpdateTime) {
		this.lastUpdateTime = lastUpdateTime;
	}
	@ManyToOne
	@JoinColumn(name="user_Id")
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	@ManyToOne
	@JoinColumn(name="sos_Id")
	public SosOrder getSosOrder() {
		return sosOrder;
	}
	public void setSosOrder(SosOrder sosOrder) {
		this.sosOrder = sosOrder;
	}
	
	

}
